<template>
  <div>
    <div class="liveStart" v-if="type === 'live'">
      <i class="icon-live"><img src="../assets/images/live.svg" alt="" /></i>
      <i class="text">直播中</i>
    </div>
    <div class="liveBanner" v-else-if="type === 'liveBanner'">
      <i class="icon-live"><img src="../assets/images/live.svg" alt="" /></i>
      <i class="text">直播中</i>
    </div>
    <div class="liveEnd" v-else>
      <i class="icon-live"><img src="../assets/images/icon-time.png" alt="" /></i>
      <i class="text">已收盘</i>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Icon',
  data() {
    return {};
  },
  props: {
    type: {
      type: String,
      default: '',
    },
  },
};
</script>

<style lang="less" scoped>
.liveStart {
  width: 1.04rem;
  height: 0.36rem;
  background: #ff2436;
  border-radius: 0.08rem;
  line-height: 0.28rem;
  .icon-live {
    width: 0.2rem;
    height: 0.24rem;
    position: relative;
    margin-left: 0.08rem;
    margin-right: 0.04rem;
    img {
      width: 0.2rem;
    }
  }

  .text {
    height: 0.36rem;
    font-size: 0.2rem;
    color: #ffffff;
    line-height: 0.2rem;
    font-weight: 500;
  }
}

.liveBanner {
  width: 1.1rem;
  height: 0.32rem;
  background: #ff2436;
  border-radius: 0.04rem;
  line-height: 0.32rem;
  display: flex;
  .icon-live {
    width: 0.24rem;
    height: 0.24rem;
    position: relative;
    margin-left: 0.08rem;
    margin-right: 0.04rem;
    img {
      margin-bottom: 0.08rem;
      width: 0.24rem;
    }
  }
  .text {
    font-size: 0.22rem;
    color: #ffffff;
    line-height: 0.32rem;
    height: 0.32rem;
    font-weight: 500;
  }
}
.liveEnd {
  height: 0.36rem;
  background: #f6f6f6;
  border-radius: 0.08rem;
  padding: 0 0.1rem;
  line-height: 0.2rem;
  display: flex;
  align-items: center;
  .icon-live {
    width: 0.24rem;
    height: 0.24rem;
    position: relative;
    margin-right: 0.04rem;
    img {
      margin-bottom: 0.08rem;
      width: 0.24rem;
    }
  }
  .text {
    line-height: 0.36rem;
    font-size: 0.2rem;
    color: rgba(0, 0, 0, 0.4);
    font-weight: 500;
  }
}
</style>
